package com.lenovo.rc.sil.wangdwa.learning;

import android.os.Parcel;
import android.os.Parcelable;

public class Kid implements Parcelable {
	
	public static final int SEX_FEMALE = 1;
	public static final int SEX_MALE = 0;
	
	private String name = null;
	private int sex = 1;
	private String birthday = null;
	
	// must have CREATOR
	public static final Parcelable.Creator<Kid> CREATOR 
		= new Parcelable.Creator<Kid>() {

			@Override
			public Kid createFromParcel(Parcel source) {
				// TODO Auto-generated method stub
				return new Kid(source);
			}

			@Override
			public Kid[] newArray(int size) {
				// TODO Auto-generated method stub
				return new Kid[size];
			}
		
		};
	
	// needed in CREATOR
	public Kid(Parcel source) {
		// TODO Auto-generated constructor stub
		this.name = source.readString();
		this.sex = source.readInt();
		this.birthday = source.readString();
	}
	
	

	public Kid(String name, int sex, String birthday) {
		super();
		this.name = name;
		this.sex = sex;
		this.birthday = birthday;
	}



	public String getName() {
		return name;
	}



	public void setName(String name) {
		this.name = name;
	}



	public int getSex() {
		return sex;
	}



	public void setSex(int sex) {
		this.sex = sex;
	}



	public String getBirthday() {
		return birthday;
	}



	public void setBirthday(String birthday) {
		this.birthday = birthday;
	}



	@Override
	public String toString() {
		return "Kid [name=" + name + ", sex=" + sex + ", birthday=" + birthday
				+ "]";
	}



	@Override
	public int describeContents() {
		// TODO Auto-generated method stub
		return 0;
	}

	@Override
	public void writeToParcel(Parcel dest, int flags) {
		// TODO Auto-generated method stub
		dest.writeString(this.name);
		dest.writeInt(this.sex);
		dest.writeString(this.birthday);
		
	}

}
